﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone"
                    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                    xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"
                    mc:Ignorable="d">
    <!--  Resource dictionary entries should be defined here.  -->
    <converter:BooleanToVisibilityConverter xmlns:converter="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" x:Key="VisibleConverter" />
    <sys:String x:Key="AppName">口袋购物-逛淘宝</sys:String>
    <SolidColorBrush x:Key="AppBackBrush" Color="#FFFBFAF6" />
    <SolidColorBrush x:Key="AppBarBrush" Color="#FFD1BCA1" />

    <SolidColorBrush x:Key="TextColorLightBrush" Color="#FFFF861E" />
    <SolidColorBrush x:Key="TextColorDarkBrush" Color="#FF6A6A6A" />
    <SolidColorBrush x:Key="AppTitleBrush" Color="#FFD27A2D" />
    <SolidColorBrush x:Key="ImageWallBackBrush" Color="#FFF2EFED" />
    <SolidColorBrush x:Key="SearchFocusBrush" Color="#FF535353" />
    <ImageBrush x:Key="BackgroundImageBrush" ImageSource="/Images/kd_background.png" />

    <Color x:Key="AppBarColor">#FFD1BCA1</Color>

    <DataTemplate x:Key="HotDataTemplate">
        <Grid Width="215"
              Height="177"
              Margin="2">
            <Image Source="{Binding ImageUrl}"
                   Stretch="UniformToFill"
                   toolkit:TiltEffect.IsTiltEnabled="True" />
            <Grid Height="45" VerticalAlignment="Bottom">
                <Rectangle Margin="0" Fill="{Binding RectColor}" />
                <TextBlock Margin="10,0,0,0"
                           VerticalAlignment="Center"
                           Text="{Binding OriginalAppName}"
                           TextWrapping="Wrap" />
            </Grid>
        </Grid>
    </DataTemplate>
    <ItemsPanelTemplate x:Key="WrapPanelTemplate">
        <toolkit:WrapPanel Orientation="Horizontal" />
    </ItemsPanelTemplate>

    <Style x:Key="CommonPivotStyle" TargetType="phone:Pivot">
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Grid />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="phone:Pivot">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid Grid.RowSpan="3" Background="{TemplateBinding Background}" />
                        <ContentControl Margin="24,17,0,-7"
                                        HorizontalAlignment="Left"
                                        Content="{TemplateBinding Title}"
                                        ContentTemplate="{TemplateBinding TitleTemplate}"
                                        Style="{StaticResource PivotTitleStyle}" />
                        <Primitives:PivotHeadersControl x:Name="HeadersListElement"
                                                        Grid.Row="1"
                                                        Foreground="{StaticResource TextColorLightBrush}" />
                        <ItemsPresenter x:Name="PivotItemPresenter"
                                        Grid.Row="2"
                                        Margin="{TemplateBinding Padding}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="AppTitleTextBlockStyle"
           BasedOn="{StaticResource PhoneTextNormalStyle}"
           TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource AppTitleBrush}" />
        <Setter Property="FontSize" Value="25" />
        <Setter Property="Text" Value="{StaticResource AppName}" />
    </Style>

    <Style x:Key="NoBorderNoThicknessButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground"
                                Background="{x:Null}"
                                BorderBrush="{x:Null}"
                                CornerRadius="0">
                            <ContentControl x:Name="ContentContainer"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                            Content="{TemplateBinding Content}"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
                                            Foreground="{StaticResource PhoneContrastBackgroundBrush}"
                                            Padding="{TemplateBinding Padding}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SearchBtnStyle" TargetType="Button">
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Background" Value="{StaticResource TextColorLightBrush}" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius="0">
                            <ContentControl x:Name="ContentContainer"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                            Content="{TemplateBinding Content}"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
                                            Foreground="{TemplateBinding Foreground}"
                                            Padding="{TemplateBinding Padding}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}" />
        <Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}" />
        <Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyContent" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxReadOnlyBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="InvalidFocused" />
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="EnabledBorder"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{StaticResource TextColorDarkBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentControl x:Name="ContentElement"
                                            Margin="5,2,1,2"
                                            VerticalAlignment="Center"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"
                                            BorderThickness="0"
                                            Padding="{TemplateBinding Padding}" />
                        </Border>
                        <Border x:Name="DisabledOrReadonlyBorder"
                                Margin="{StaticResource PhoneTouchTargetOverhang}"
                                Background="Transparent"
                                BorderBrush="{StaticResource PhoneDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Visibility="Collapsed">
                            <TextBox x:Name="DisabledOrReadonlyContent"
                                     Background="Transparent"
                                     FontFamily="{TemplateBinding FontFamily}"
                                     FontSize="{TemplateBinding FontSize}"
                                     FontStyle="{TemplateBinding FontStyle}"
                                     FontWeight="{TemplateBinding FontWeight}"
                                     Foreground="{StaticResource PhoneDisabledBrush}"
                                     IsReadOnly="True"
                                     SelectionBackground="{TemplateBinding SelectionBackground}"
                                     SelectionForeground="{TemplateBinding SelectionForeground}"
                                     Template="{StaticResource PhoneDisabledTextBoxTemplate}"
                                     Text="{TemplateBinding Text}"
                                     TextAlignment="{TemplateBinding TextAlignment}"
                                     TextWrapping="{TemplateBinding TextWrapping}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="PhoneDisabledTextBoxTemplate" TargetType="TextBox">
        <ContentControl x:Name="ContentElement"
                        Margin="{StaticResource PhoneTextBoxInnerMargin}"
                        HorizontalContentAlignment="Stretch"
                        VerticalContentAlignment="Stretch"
                        BorderThickness="0"
                        Padding="{TemplateBinding Padding}" />
    </ControlTemplate>
    <SolidColorBrush x:Key="HotListLightBrush" Color="#FFBEBEBE" />

    <ControlTemplate x:Key="PhoneScrollbarThumb" TargetType="Thumb">
        <Rectangle Width="{TemplateBinding Width}"
                   Height="{TemplateBinding Height}"
                   Fill="{StaticResource HotListLightBrush}"
                   IsHitTestVisible="False" />
    </ControlTemplate>
    <Style x:Key="KDScrollBarStyle" TargetType="ScrollBar">
        <Setter Property="Background" Value="{StaticResource PhoneDisabledBrush}" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MinWidth" Value="5" />
        <Setter Property="MinHeight" Value="5" />
        <Setter Property="IsHitTestVisible" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollBar">
                    <Grid>
                        <Grid x:Name="VerticalRoot"
                              Width="{TemplateBinding Width}"
                              Background="Transparent">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <RepeatButton x:Name="VerticalSmallDecrease" Visibility="Collapsed" />
                            <RepeatButton x:Name="VerticalLargeDecrease"
                                          Grid.Row="1"
                                          Width="0"
                                          Template="{x:Null}" />
                            <Thumb x:Name="VerticalThumb"
                                   Grid.Row="2"
                                   Width="{TemplateBinding Width}"
                                   MinHeight="72"
                                   Margin="{TemplateBinding Padding}"
                                   Background="{TemplateBinding Background}"
                                   Template="{StaticResource PhoneScrollbarThumb}" />
                            <RepeatButton x:Name="VerticalLargeIncrease"
                                          Grid.Row="3"
                                          Width="0"
                                          Template="{x:Null}" />
                            <RepeatButton x:Name="VerticalSmallIncrease" Visibility="Collapsed" />
                        </Grid>
                        <Grid x:Name="HorizontalRoot"
                              Height="{TemplateBinding Height}"
                              Background="Transparent">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <RepeatButton x:Name="HorizontalSmallDecrease" Visibility="Collapsed" />
                            <RepeatButton x:Name="HorizontalLargeDecrease"
                                          Grid.Column="1"
                                          Height="0"
                                          Template="{x:Null}" />
                            <Thumb x:Name="HorizontalThumb"
                                   Grid.Column="2"
                                   Height="{TemplateBinding Height}"
                                   MinWidth="72"
                                   Margin="{TemplateBinding Padding}"
                                   Background="{TemplateBinding Background}"
                                   Template="{StaticResource PhoneScrollbarThumb}" />
                            <RepeatButton x:Name="HorizontalLargeIncrease"
                                          Grid.Column="3"
                                          Height="0"
                                          Template="{x:Null}" />
                            <RepeatButton x:Name="HorizontalSmallIncrease" Visibility="Collapsed" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="KDScrollViewerStyle" TargetType="ScrollViewer">
        <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ScrollStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.5" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Scrolling">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="VerticalScrollBar"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="HorizontalScrollBar"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotScrolling" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}">
                            <ScrollContentPresenter x:Name="ScrollContentPresenter"
                                                    Content="{TemplateBinding Content}"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}" />
                            <ScrollBar x:Name="VerticalScrollBar"
                                       Width="5"
                                       Height="Auto"
                                       HorizontalAlignment="Right"
                                       VerticalAlignment="Stretch"
                                       IsHitTestVisible="False"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       Minimum="0"
                                       Opacity="0"
                                       Orientation="Vertical"
                                       Style="{StaticResource KDScrollBarStyle}"
                                       ViewportSize="{TemplateBinding ViewportHeight}"
                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                       Value="{TemplateBinding VerticalOffset}" />
                            <ScrollBar x:Name="HorizontalScrollBar"
                                       Width="Auto"
                                       Height="5"
                                       HorizontalAlignment="Stretch"
                                       VerticalAlignment="Bottom"
                                       IsHitTestVisible="False"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableWidth}"
                                       Minimum="0"
                                       Opacity="0"
                                       Orientation="Horizontal"
                                       ViewportSize="{TemplateBinding ViewportWidth}"
                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                       Value="{TemplateBinding HorizontalOffset}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="HotListDarkBrush" Color="#FF5D5D5D" />
    <Style x:Key="NoBorderButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{StaticResource PhoneBorderThickness}"
                                CornerRadius="0">
                            <ContentControl x:Name="ContentContainer"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                            Content="{TemplateBinding Content}"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
                                            Foreground="{TemplateBinding Foreground}"
                                            Padding="{TemplateBinding Padding}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="KDButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Padding" Value="10,3,10,5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                        To="#FFFF871F"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        To="#FFFF871F"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ContentContainer"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="White"
                                                        d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                        To="#FFFF871F"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        To="#FFFF871F"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ContentContainer"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="White"
                                                        d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ContentContainer"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="#FF0B0B0B"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                        To="#FFE6E6E6"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        To="#FFE6E6E6"
                                                        d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ContentContainer"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="#FFF6F6F6"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                        To="#FFFF871F"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ButtonBackground"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        To="#FFFF871F"
                                                        d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground"
                                Margin="{StaticResource PhoneTouchTargetOverhang}"
                                Background="Black"
                                BorderBrush="#00000000"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0">
                            <ContentControl x:Name="ContentContainer"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                            Content="{TemplateBinding Content}"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
                                            Padding="{TemplateBinding Padding}">
                                <ContentControl.BorderBrush>
                                    <SolidColorBrush Color="{StaticResource PhoneBorderColor}" />
                                </ContentControl.BorderBrush>
                            </ContentControl>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TransitionPageStyle" TargetType="phone:PhoneApplicationPage">
        <Setter Property="toolkit:TransitionService.NavigationInTransition">
            <Setter.Value>
                <toolkit:NavigationInTransition>
                    <toolkit:NavigationInTransition.Backward>
                        <toolkit:SlideTransition Mode="SlideRightFadeIn" />
                    </toolkit:NavigationInTransition.Backward>
                    <toolkit:NavigationInTransition.Forward>
                        <toolkit:SlideTransition Mode="SlideLeftFadeIn" />
                    </toolkit:NavigationInTransition.Forward>
                </toolkit:NavigationInTransition>
            </Setter.Value>
        </Setter>
        <Setter Property="toolkit:TransitionService.NavigationOutTransition">
            <Setter.Value>
                <toolkit:NavigationOutTransition>
                    <toolkit:NavigationOutTransition.Backward>
                        <toolkit:SlideTransition Mode="SlideRightFadeOut" />
                    </toolkit:NavigationOutTransition.Backward>
                    <toolkit:NavigationOutTransition.Forward>
                        <toolkit:SlideTransition Mode="SlideLeftFadeOut" />
                    </toolkit:NavigationOutTransition.Forward>
                </toolkit:NavigationOutTransition>
            </Setter.Value>
        </Setter>
    </Style>

    <sys:String x:Key="SettingName">设置</sys:String>

    <Style x:Key="SettingPivotStyle" TargetType="controls:Pivot">
        <Setter Property="TitleTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock FontSize="25"
                               Foreground="{StaticResource AppTitleBrush}"
                               Text="{StaticResource SettingName}" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{StaticResource TextColorLightBrush}" />
    </Style>

    <Style x:Key="SetMainLabelStyle" TargetType="TextBlock">
        <Setter Property="FontSize" Value="35" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Foreground" Value="#535353" />
        <Setter Property="Height" Value="85" />
        <Setter Property="Width" Value="440" />
    </Style>

    <Style x:Key="SetSecondLabelStyle" TargetType="TextBlock">
        <Setter Property="FontSize" Value="23" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Foreground" Value="#9c9c9c" />
        <Setter Property="Margin" Value="3,-30,0,0" />
    </Style>

    <Style x:Key="ToggleSwitchButtonStyle" TargetType="toolkitPrimitives:ToggleSwitchButton">
        <Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="SwitchForeground" Value="{StaticResource PhoneAccentBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkitPrimitives:ToggleSwitchButton">
                    <Border x:Name="Root"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CacheMode="BitmapCache"
                            Opacity="{TemplateBinding Opacity}"
                            Padding="{TemplateBinding Padding}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="SwitchBottom"
                                                        Storyboard.TargetProperty="(Grid.Background).(SolidColorBrush.Color)"
                                                        To="{StaticResource PhoneForegroundColor}" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="Root"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0.3" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.05" To="Unchecked" />
                                    <VisualTransition GeneratedDuration="0:0:0.05" To="Checked" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="BackgroundTranslation"
                                                         Storyboard.TargetProperty="(TranslateTransform.X)"
                                                         To="68">
                                            <DoubleAnimation.EasingFunction>
                                                <ExponentialEase EasingMode="EaseOut" Exponent="15" />
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ThumbTranslation"
                                                         Storyboard.TargetProperty="(TranslateTransform.X)"
                                                         To="68">
                                            <DoubleAnimation.EasingFunction>
                                                <ExponentialEase EasingMode="EaseOut" Exponent="15" />
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Dragging" />
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="BackgroundTranslation"
                                                         Storyboard.TargetProperty="(TranslateTransform.X)"
                                                         To="0" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ThumbTranslation"
                                                         Storyboard.TargetProperty="(TranslateTransform.X)"
                                                         To="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="SwitchRoot"
                              Width="136"
                              Height="95"
                              Background="Transparent">
                            <Grid x:Name="SwitchTrack" Width="88">
                                <Grid x:Name="SwitchBottom"
                                      Height="32"
                                      Background="{TemplateBinding SwitchForeground}">
                                    <Rectangle x:Name="SwitchBackground"
                                               Width="76"
                                               Height="20"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center"
                                               Fill="{TemplateBinding Background}">
                                        <Rectangle.RenderTransform>
                                            <TranslateTransform x:Name="BackgroundTranslation" />
                                        </Rectangle.RenderTransform>
                                    </Rectangle>
                                    <Border BorderBrush="Black" BorderThickness="2">
                                        <Border BorderBrush="White" BorderThickness="4" />
                                    </Border>
                                </Grid>
                                <Border x:Name="SwitchThumb"
                                        Width="28"
                                        Height="36"
                                        Margin="-4,0"
                                        HorizontalAlignment="Left"
                                        BorderBrush="White"
                                        BorderThickness="4,0">
                                    <Border.RenderTransform>
                                        <TranslateTransform x:Name="ThumbTranslation" />
                                    </Border.RenderTransform>
                                    <Border x:Name="ThumbCenter"
                                            Background="#FFFAFAFA"
                                            BorderBrush="Black"
                                            BorderThickness="2" />
                                </Border>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ToggleSwitchStyle" TargetType="toolkit:ToggleSwitch">
        <Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="SwitchForeground" Value="{StaticResource PhoneAccentBrush}" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:ToggleSwitch">
                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CacheMode="BitmapCache"
                            Padding="{TemplateBinding Padding}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="Header"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0.3" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="Content"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0.3" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="0">
                            <toolkitPrimitives:ToggleSwitchButton x:Name="Switch"
                                                                  Margin="0"
                                                                  HorizontalAlignment="Left"
                                                                  VerticalAlignment="Top"
                                                                  Background="{TemplateBinding Background}"
                                                                  Opacity="{TemplateBinding Opacity}"
                                                                  Style="{StaticResource ToggleSwitchButtonStyle}"
                                                                  SwitchForeground="{TemplateBinding SwitchForeground}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MyStreetChangeButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Padding" Value="0,0,0,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ImageBack"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.5"
                                                         d:IsOptimized="True" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ImageBack"
                                                         Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
                                                         To="0.8"
                                                         d:IsOptimized="True" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ImageBack"
                                                         Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
                                                         To="0.8"
                                                         d:IsOptimized="True" />
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ImageFront" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="2" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ImageFront" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="2" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ImageFront" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Image x:Name="ImageBack"
                               Opacity="0"
                               RenderTransformOrigin="0.5,0.5"
                               Source="/Images/appbar.nextstreet.png">
                            <Image.RenderTransform>
                                <CompositeTransform />
                            </Image.RenderTransform>
                        </Image>
                        <Image x:Name="ImageFront"
                               RenderTransformOrigin="0.5,0.5"
                               Source="/Images/appbar.nextstreet.png">
                            <Image.RenderTransform>
                                <CompositeTransform />
                            </Image.RenderTransform>
                        </Image>
                        <TextBlock x:Name="textBlock"
                                   Margin="0,14,0,0"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   FontSize="{TemplateBinding FontSize}"
                                   Foreground="{TemplateBinding Foreground}"
                                   Text="{TemplateBinding Content}"
                                   TextWrapping="Wrap"
                                   d:LayoutOverrides="Width" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="PivotStatesChangedTemplate" TargetType="phone:Pivot">
        <Grid x:Name="grid1"
              HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
              VerticalAlignment="{TemplateBinding VerticalAlignment}"
              RenderTransformOrigin="0.5,0.5">
            <Grid.RenderTransform>
                <CompositeTransform />
            </Grid.RenderTransform>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="VisualStateGroup">
                    <VisualState x:Name="HideHeaderTitlelState">



                        <Storyboard>
                            <DoubleAnimation Duration="0:0:1"
                                             Storyboard.TargetName="contentPresenter"
                                             Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
                                             To="-150"
                                             d:IsOptimized="True" />
                            <DoubleAnimation Duration="0:0:1"
                                             Storyboard.TargetName="HeadersListElement"
                                             Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
                                             To="-150"
                                             d:IsOptimized="True" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PivotItemPresenter" Storyboard.TargetProperty="(Grid.Row)">
                                <DiscreteObjectKeyFrame KeyTime="0:0:1">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>0</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PivotItemPresenter" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0:0:1">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>



                    </VisualState>
                    <VisualState x:Name="ShowHeaderTitleState">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="-150" />
                                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HeadersListElement" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="-150" />
                                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid x:Name="grid"
                  Grid.RowSpan="3"
                  Background="{TemplateBinding Background}"
                  CacheMode="BitmapCache"
                  RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <CompositeTransform />
                </Grid.RenderTransform>
            </Grid>
            <ContentPresenter x:Name="contentPresenter"
                              Margin="24,17,0,-7"
                              Content="{TemplateBinding Title}"
                              ContentTemplate="{TemplateBinding TitleTemplate}"
                              RenderTransformOrigin="0.5,0.5">
                <ContentPresenter.Projection>
                    <PlaneProjection />
                </ContentPresenter.Projection>
                <ContentPresenter.RenderTransform>
                    <CompositeTransform />
                </ContentPresenter.RenderTransform>
            </ContentPresenter>
            <controlsPrimitives:PivotHeadersControl x:Name="HeadersListElement"
                                                    Grid.Row="1"
                                                    RenderTransformOrigin="0.5,0.5">
                <controlsPrimitives:PivotHeadersControl.Projection>
                    <PlaneProjection />
                </controlsPrimitives:PivotHeadersControl.Projection>
                <controlsPrimitives:PivotHeadersControl.RenderTransform>
                    <CompositeTransform />
                </controlsPrimitives:PivotHeadersControl.RenderTransform>
            </controlsPrimitives:PivotHeadersControl>
            <ItemsPresenter x:Name="PivotItemPresenter"
                            Grid.Row="2"
                            Margin="{TemplateBinding Padding}" />
        </Grid>
    </ControlTemplate>
</ResourceDictionary>